import request from '@/utils/request';
const basePath = '/appsys/user/UserRest';
import type { BaseBeanModel, ResponsePageData, QueryParamModel } from '@/api/model/baseModel';

export interface SysUserAuthViewDto extends BaseBeanModel {
  /** 用户姓名 */
  name?: any;
  /** 登录名 */
  no?: any;
  /** 用户类型 */
  type?: any;
  /** 部门 */
  deptId?: any;
  deptName?: any;
  /** 角色 */
  positionId?: any;
  positionName?: any;
  /** 状态 */
  status?: any;
}

/**
 * 获取分页数据
 * @param param QueryParamModel
 * @returns 列表数据
 */
export function listAllConsoleUserByPage(param: QueryParamModel): Promise<ResponsePageData<SysUserAuthViewDto>> {
  return request.post(`${basePath}/getAllConsoleUserList/v1`, param);
}

/**
 * 根据用户id加载菜单树
 * @param userId 用户id
 * @param menuType 菜单类型
 * @returns 所选用户对应的菜单
 */
export function getMenuAuthTreeByUserId(userId, menuType) {
  return request.post(`/appsys/auth/AuthRest/getMenuAuthTreeByUserId/v1/${userId}/${menuType}`);
}
